-
Notifications
You must be signed in to change notification settings - Fork 14k
alloc: Document panics when allocations will exceed max #148662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
|
At a glance, the build failures appear to be related to CI setup and not to these changes. |
|
CI is currently broken, it should be fixed once #148665 is merged. |
7528a5b to
7c84655
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thank you!
library/alloc/src/string.rs
Outdated
| /// | ||
| /// # Panics | ||
| /// | ||
| /// Panics if the new capacity exceeds `isize::MAX` _bytes_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't an old capacity here.
| /// Panics if the new capacity exceeds `isize::MAX` _bytes_. | |
| /// Panics if the capacity exceeds `isize::MAX` _bytes_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do prefer the suggested wording. Presently, Vec uses the "new capacity" phrasing; should I adjust that as well?
7c84655 to
5a8cf33
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Document panics in
StringandVecdue to capacity overflowingisize::MAX. Correct outdated claims ofusize::MAXlimit.Fixes #148598.
Ping @lolbinarycat